

var text = ""


Page({

  data : {
      showTitle : [1,2,3,4,5,6]
  },

  textChange (content) {
    text = content.detail.value;
  },

  addClick () {

    var list = this.data.showTitle;
    list.push(text);

    this.setData({
      showTitle : list
    })

  },

  clearClick () {
    var list = this.data.showTitle;

    var newList = [];

    for (let index = 0; index < list.length; index++) {

      if (Number(text) != list[index]) {
        newList.push(list[index])
      }

    }

    this.setData({
      showTitle : newList
    })
  }










})